/**
 *
 */
import Util;
import OpenApi;

import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('babel', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ClientReportRequest {
  callerType?: string(name='CallerType'),
  clientInformation?: string(name='ClientInformation'),
  productCode?: string(name='ProductCode'),
}

model ClientReportResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ClientReportResponse = {
  headers: map[string]string(name='headers'),
  body: ClientReportResponseBody(name='body'),
}

async function clientReportWithOptions(request: ClientReportRequest, runtime: Util.RuntimeOptions): ClientReportResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ClientReport', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function clientReport(request: ClientReportRequest): ClientReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return clientReportWithOptions(request, runtime);
}

model CountProductSpiServiceRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  apiType?: string(name='ApiType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  isActivate?: boolean(name='IsActivate'),
  environment?: string(name='Environment'),
}

model CountProductSpiServiceResponseBody = {
  requestId?: string(name='RequestId'),
  count?: long(name='Count'),
  success?: boolean(name='Success'),
}

model CountProductSpiServiceResponse = {
  headers: map[string]string(name='headers'),
  body: CountProductSpiServiceResponseBody(name='body'),
}

async function countProductSpiServiceWithOptions(request: CountProductSpiServiceRequest, runtime: Util.RuntimeOptions): CountProductSpiServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CountProductSpiService', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function countProductSpiService(request: CountProductSpiServiceRequest): CountProductSpiServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return countProductSpiServiceWithOptions(request, runtime);
}

model DisableProductSpiServiceRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  apiType?: string(name='ApiType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  environment?: string(name='Environment'),
}

model DisableProductSpiServiceResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableProductSpiServiceResponse = {
  headers: map[string]string(name='headers'),
  body: DisableProductSpiServiceResponseBody(name='body'),
}

async function disableProductSpiServiceWithOptions(request: DisableProductSpiServiceRequest, runtime: Util.RuntimeOptions): DisableProductSpiServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DisableProductSpiService', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function disableProductSpiService(request: DisableProductSpiServiceRequest): DisableProductSpiServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableProductSpiServiceWithOptions(request, runtime);
}

model EnableProductSpiServiceRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  apiType?: string(name='ApiType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  environment?: string(name='Environment'),
}

model EnableProductSpiServiceResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableProductSpiServiceResponse = {
  headers: map[string]string(name='headers'),
  body: EnableProductSpiServiceResponseBody(name='body'),
}

async function enableProductSpiServiceWithOptions(request: EnableProductSpiServiceRequest, runtime: Util.RuntimeOptions): EnableProductSpiServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('EnableProductSpiService', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function enableProductSpiService(request: EnableProductSpiServiceRequest): EnableProductSpiServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableProductSpiServiceWithOptions(request, runtime);
}

model FindServiceProviderCodeByUidRequest {
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
}

model FindServiceProviderCodeByUidResponseBody = {
  requestId?: string(name='RequestId'),
  serviceProviderCode?: string(name='ServiceProviderCode'),
  success?: boolean(name='Success'),
}

model FindServiceProviderCodeByUidResponse = {
  headers: map[string]string(name='headers'),
  body: FindServiceProviderCodeByUidResponseBody(name='body'),
}

async function findServiceProviderCodeByUidWithOptions(request: FindServiceProviderCodeByUidRequest, runtime: Util.RuntimeOptions): FindServiceProviderCodeByUidResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FindServiceProviderCodeByUid', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function findServiceProviderCodeByUid(request: FindServiceProviderCodeByUidRequest): FindServiceProviderCodeByUidResponse {
  var runtime = new Util.RuntimeOptions{};
  return findServiceProviderCodeByUidWithOptions(request, runtime);
}

model GetRootBusinessLocationsRequest {
  productCode?: string(name='ProductCode'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
}

model GetRootBusinessLocationsResponseBody = {
  requestId?: string(name='RequestId'),
  locations?: {
    location?: [ string ](name='Location')
  }(name='Locations'),
  success?: boolean(name='Success'),
}

model GetRootBusinessLocationsResponse = {
  headers: map[string]string(name='headers'),
  body: GetRootBusinessLocationsResponseBody(name='body'),
}

async function getRootBusinessLocationsWithOptions(request: GetRootBusinessLocationsRequest, runtime: Util.RuntimeOptions): GetRootBusinessLocationsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetRootBusinessLocations', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getRootBusinessLocations(request: GetRootBusinessLocationsRequest): GetRootBusinessLocationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRootBusinessLocationsWithOptions(request, runtime);
}

model ListAllServiceProviderRequest {
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
}

model ListAllServiceProviderResponseBody = {
  requestId?: string(name='RequestId'),
  serviceProviderList?: [ 
    {
      cnName?: string(name='cnName'),
      providerUid?: string(name='providerUid'),
      enName?: string(name='enName'),
      providerType?: string(name='providerType'),
      remark?: string(name='remark'),
      providerCode?: string(name='providerCode'),
    }
  ](name='ServiceProviderList'),
  success?: boolean(name='Success'),
}

model ListAllServiceProviderResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllServiceProviderResponseBody(name='body'),
}

async function listAllServiceProviderWithOptions(request: ListAllServiceProviderRequest, runtime: Util.RuntimeOptions): ListAllServiceProviderResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListAllServiceProvider', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listAllServiceProvider(request: ListAllServiceProviderRequest): ListAllServiceProviderResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllServiceProviderWithOptions(request, runtime);
}

model LookupAllActiveProductSpiServiceListRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  environment?: string(name='Environment'),
  apiType?: string(name='ApiType'),
  spiChannel?: string(name='SpiChannel'),
  spiGroup?: string(name='SpiGroup'),
}

model LookupAllActiveProductSpiServiceListResponseBody = {
  requestId?: string(name='RequestId'),
  productSpiServiceList?: [ 
    {
      type?: string(name='Type'),
      isDefault?: boolean(name='isDefault'),
      action?: string(name='Action'),
      domain?: string(name='Domain'),
      spiChannel?: string(name='SpiChannel'),
      apiType?: string(name='ApiType'),
      isActivate?: boolean(name='IsActivate'),
      regionId?: string(name='RegionId'),
      targetRegion?: string(name='TargetRegion'),
      version?: string(name='Version'),
      spiGroup?: string(name='SpiGroup'),
      environment?: string(name='Environment'),
      id?: long(name='Id'),
      productCode?: string(name='ProductCode'),
    }
  ](name='ProductSpiServiceList'),
  success?: boolean(name='Success'),
}

model LookupAllActiveProductSpiServiceListResponse = {
  headers: map[string]string(name='headers'),
  body: LookupAllActiveProductSpiServiceListResponseBody(name='body'),
}

async function lookupAllActiveProductSpiServiceListWithOptions(request: LookupAllActiveProductSpiServiceListRequest, runtime: Util.RuntimeOptions): LookupAllActiveProductSpiServiceListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('LookupAllActiveProductSpiServiceList', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function lookupAllActiveProductSpiServiceList(request: LookupAllActiveProductSpiServiceListRequest): LookupAllActiveProductSpiServiceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return lookupAllActiveProductSpiServiceListWithOptions(request, runtime);
}

model LookupProductSpiServiceRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  apiType?: string(name='ApiType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  environment?: string(name='Environment'),
}

model LookupProductSpiServiceResponseBody = {
  requestId?: string(name='RequestId'),
  productSpiService?: {
    type?: string(name='Type'),
    isDefault?: boolean(name='IsDefault'),
    action?: string(name='Action'),
    domain?: string(name='Domain'),
    version?: string(name='Version'),
    apiType?: string(name='ApiType'),
    isActivate?: boolean(name='IsActivate'),
    environment?: string(name='Environment'),
    id?: long(name='Id'),
    regionId?: string(name='RegionId'),
    productCode?: string(name='ProductCode'),
  }(name='ProductSpiService'),
  success?: boolean(name='Success'),
}

model LookupProductSpiServiceResponse = {
  headers: map[string]string(name='headers'),
  body: LookupProductSpiServiceResponseBody(name='body'),
}

async function lookupProductSpiServiceWithOptions(request: LookupProductSpiServiceRequest, runtime: Util.RuntimeOptions): LookupProductSpiServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('LookupProductSpiService', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function lookupProductSpiService(request: LookupProductSpiServiceRequest): LookupProductSpiServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return lookupProductSpiServiceWithOptions(request, runtime);
}

model LookupProductSpiServiceListRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  apiType?: string(name='ApiType'),
  isActivate?: boolean(name='IsActivate'),
  environment?: string(name='Environment'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
}

model LookupProductSpiServiceListResponseBody = {
  requestId?: string(name='RequestId'),
  productSpiServiceList?: [ 
    {
      type?: string(name='Type'),
      isDefault?: boolean(name='IsDefault'),
      action?: string(name='Action'),
      domain?: string(name='Domain'),
      version?: string(name='Version'),
      apiType?: string(name='ApiType'),
      isActivate?: boolean(name='IsActivate'),
      environment?: string(name='Environment'),
      id?: long(name='Id'),
      regionId?: string(name='RegionId'),
      productCode?: string(name='ProductCode'),
    }
  ](name='ProductSpiServiceList'),
  success?: boolean(name='Success'),
}

model LookupProductSpiServiceListResponse = {
  headers: map[string]string(name='headers'),
  body: LookupProductSpiServiceListResponseBody(name='body'),
}

async function lookupProductSpiServiceListWithOptions(request: LookupProductSpiServiceListRequest, runtime: Util.RuntimeOptions): LookupProductSpiServiceListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('LookupProductSpiServiceList', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function lookupProductSpiServiceList(request: LookupProductSpiServiceListRequest): LookupProductSpiServiceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return lookupProductSpiServiceListWithOptions(request, runtime);
}

model NotifyMessageRepeaterRequest {
  topic?: string(name='Topic'),
  messageBody?: string(name='MessageBody'),
  tag?: string(name='Tag'),
  driver?: string(name='Driver'),
}

model NotifyMessageRepeaterResponseBody = {
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  success?: boolean(name='Success'),
}

model NotifyMessageRepeaterResponse = {
  headers: map[string]string(name='headers'),
  body: NotifyMessageRepeaterResponseBody(name='body'),
}

async function notifyMessageRepeaterWithOptions(request: NotifyMessageRepeaterRequest, runtime: Util.RuntimeOptions): NotifyMessageRepeaterResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('NotifyMessageRepeater', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function notifyMessageRepeater(request: NotifyMessageRepeaterRequest): NotifyMessageRepeaterResponse {
  var runtime = new Util.RuntimeOptions{};
  return notifyMessageRepeaterWithOptions(request, runtime);
}

model NotifyUserBusinessCommandRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  commandBody?: string(name='CommandBody'),
  clientToken?: string(name='ClientToken'),
}

model NotifyUserBusinessCommandResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  messageID?: string(name='MessageID'),
}

model NotifyUserBusinessCommandResponse = {
  headers: map[string]string(name='headers'),
  body: NotifyUserBusinessCommandResponseBody(name='body'),
}

async function notifyUserBusinessCommandWithOptions(request: NotifyUserBusinessCommandRequest, runtime: Util.RuntimeOptions): NotifyUserBusinessCommandResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('NotifyUserBusinessCommand', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function notifyUserBusinessCommand(request: NotifyUserBusinessCommandRequest): NotifyUserBusinessCommandResponse {
  var runtime = new Util.RuntimeOptions{};
  return notifyUserBusinessCommandWithOptions(request, runtime);
}

model PaginateSpiEndpointSnapshotRequest {
  productCode?: string(name='ProductCode'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  apiType?: string(name='ApiType'),
  currentVersionStamp?: string(name='CurrentVersionStamp'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
}

model PaginateSpiEndpointSnapshotResponseBody = {
  spiEndpointSnapshotList?: [ 
    {
      defaultEndpoint?: {
        domain?: string(name='Domain'),
        protocols?: [ string ](name='Protocols'),
      }(name='DefaultEndpoint'),
      apiType?: string(name='ApiType'),
      routeRules?: [ 
        {
          type?: string(name='Type'),
          params?: [ string ](name='Params'),
          evaluator?: string(name='Evaluator'),
          priority?: string(name='Priority'),
        }
      ](name='RouteRules'),
      versionStamp?: string(name='VersionStamp'),
      productCode?: string(name='ProductCode'),
      regionId?: string(name='RegionId'),
    }
  ](name='SpiEndpointSnapshotList'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  pageNo?: int32(name='PageNo'),
  success?: boolean(name='Success'),
}

model PaginateSpiEndpointSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: PaginateSpiEndpointSnapshotResponseBody(name='body'),
}

async function paginateSpiEndpointSnapshotWithOptions(request: PaginateSpiEndpointSnapshotRequest, runtime: Util.RuntimeOptions): PaginateSpiEndpointSnapshotResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('PaginateSpiEndpointSnapshot', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function paginateSpiEndpointSnapshot(request: PaginateSpiEndpointSnapshotRequest): PaginateSpiEndpointSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  return paginateSpiEndpointSnapshotWithOptions(request, runtime);
}

model RegisterProductSpiServiceRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  apiType?: string(name='ApiType'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  endpoint?: string(name='Endpoint'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  actionMethod?: string(name='ActionMethod'),
  isActivate?: boolean(name='IsActivate'),
  environment?: string(name='Environment'),
}

model RegisterProductSpiServiceResponseBody = {
  requestId?: string(name='RequestId'),
  resultMessage?: string(name='ResultMessage'),
  success?: boolean(name='Success'),
}

model RegisterProductSpiServiceResponse = {
  headers: map[string]string(name='headers'),
  body: RegisterProductSpiServiceResponseBody(name='body'),
}

async function registerProductSpiServiceWithOptions(request: RegisterProductSpiServiceRequest, runtime: Util.RuntimeOptions): RegisterProductSpiServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RegisterProductSpiService', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function registerProductSpiService(request: RegisterProductSpiServiceRequest): RegisterProductSpiServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return registerProductSpiServiceWithOptions(request, runtime);
}

model SendCommonMessageRequest {
  callerType?: string(name='CallerType'),
  messageBody?: string(name='MessageBody'),
  messageTag?: string(name='MessageTag'),
  clientToken?: string(name='ClientToken'),
}

model SendCommonMessageResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  messageID?: string(name='MessageID'),
}

model SendCommonMessageResponse = {
  headers: map[string]string(name='headers'),
  body: SendCommonMessageResponseBody(name='body'),
}

async function sendCommonMessageWithOptions(request: SendCommonMessageRequest, runtime: Util.RuntimeOptions): SendCommonMessageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SendCommonMessage', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function sendCommonMessage(request: SendCommonMessageRequest): SendCommonMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCommonMessageWithOptions(request, runtime);
}

model SetProductSpiServiceDefaultRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  apiType?: string(name='ApiType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  environment?: string(name='Environment'),
}

model SetProductSpiServiceDefaultResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SetProductSpiServiceDefaultResponse = {
  headers: map[string]string(name='headers'),
  body: SetProductSpiServiceDefaultResponseBody(name='body'),
}

async function setProductSpiServiceDefaultWithOptions(request: SetProductSpiServiceDefaultRequest, runtime: Util.RuntimeOptions): SetProductSpiServiceDefaultResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetProductSpiServiceDefault', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setProductSpiServiceDefault(request: SetProductSpiServiceDefaultRequest): SetProductSpiServiceDefaultResponse {
  var runtime = new Util.RuntimeOptions{};
  return setProductSpiServiceDefaultWithOptions(request, runtime);
}

model SwitchProductSpiServiceEnvironmentRequest {
  productCode?: string(name='ProductCode'),
  callerType?: string(name='CallerType'),
  empId?: string(name='EmpId'),
  uid?: string(name='Uid'),
  actionMethodRegionId?: string(name='ActionMethodRegionId'),
  actionType?: string(name='ActionType'),
  apiType?: string(name='ApiType'),
  actionMethodVersion?: string(name='ActionMethodVersion'),
  environment?: string(name='Environment'),
  targetEnv?: string(name='TargetEnv'),
}

model SwitchProductSpiServiceEnvironmentResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SwitchProductSpiServiceEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: SwitchProductSpiServiceEnvironmentResponseBody(name='body'),
}

async function switchProductSpiServiceEnvironmentWithOptions(request: SwitchProductSpiServiceEnvironmentRequest, runtime: Util.RuntimeOptions): SwitchProductSpiServiceEnvironmentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SwitchProductSpiServiceEnvironment', '2016-07-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function switchProductSpiServiceEnvironment(request: SwitchProductSpiServiceEnvironmentRequest): SwitchProductSpiServiceEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return switchProductSpiServiceEnvironmentWithOptions(request, runtime);
}

